home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 050a / snr53b.zip / PARATAG.S < prev    next >
Text File  |  1993-05-30  |  4KB  |  97 lines

  1. \  PARATAG.S
  2. \  This table tags the end of paragraphs in uncoded ASCII text.
  3. \  It would be a good idea to run COMPRESS.S on your file before running
  4. \  this table on it. That will make it easier for this table to identify
  5. \  paragraphs.
  6.  
  7. \  Throughout these equations, flag 0 is turned ON if the type of line ending
  8. \  has not been resolved, and turned OFF if it has. This allows other
  9. \  equations to do further checking as to what kind of line ending should be
  10. \  attached.
  11.  
  12. \ *************************************************************************
  13.  
  14. \  The first two equations handle the case where a line is only up to 40
  15. \  characters long. We want to tag such lines with an end of paragraph.
  16.  
  17. \v\^*(39)\v\0d\0a*00=\p0\^1<EP>\0d\0a*00
  18. \v\^*(39)\v\0d\0a*01=<EP>\0d\0a\p0\^1<EP>\0d\0a*00
  19.  
  20. \  In the above two equations, the first character is a printable wild card
  21. \  code because search equations can't begin with a variable-length string.
  22. \  Technically, then, this equation will match only lines that have at
  23. \  least 1 printable character in them (a space, a letter, a number, etc.).
  24.  
  25. \ *************************************************************************
  26.  
  27. \  The next two equations handle lines up to 80 characters long. Such lines
  28. \  will be left untagged and flag 0 will be turned ON to indicate that the
  29. \  line ending has not been resolved. If an unresolved line is followed by
  30. \  another line of up to 80 characters, the preceding line is resolved with
  31. \  an end of paragraph.
  32.  
  33. *(40)\v\^*(40)\v\0d\0a*00=*(40)\p0\^1*01
  34. *(40)\v\^*(40)\v\0d\0a*01=<EP>\0d\0a*(40)\p0\^1*01
  35.  
  36. \  Notice in the above two equations that we are checking for exactly 40
  37. \  printable characters before we check for up to 40 more. This is because an
  38. \  equation that reads \^*(80)\v will match the same lines as \^*(40)\v for
  39. \  lines under 40 characters! Why? Because the var.len. code \^ means "UP TO
  40. \  (xx) characters", and a 30-character line would be certainly less than 80
  41. \  characters just as it would be less than 40 characters, hence there's no
  42. \  distinction between the two for short lines.
  43.  
  44. \ *************************************************************************
  45.  
  46. \  The next equations handle the case where a long line is followed by a lower
  47. \  case letter. Such lines are continued as a paragraph, unless a period or
  48. \  paren follows the letter, in which case it is assumed to be the beginning
  49. \  of an outline-style point such as a) or a.
  50.  
  51. \y*01= \p0*00     \ an unresolved line followed by a lower case letter
  52. \0d\0a\y= \p2     \ a carriage return followed by a lower case letter
  53.  
  54. \y. *01=<EP>\0d\0a\p0\p1\p2*00    \ unless it looks like an outline
  55. \0d\0a\y. =<EP>\0d\0a\p2\p3\p4
  56. \y) *01=<EP>\0d\0a\p0\p1\p2*00
  57. \0d\0a\y) =<EP>\0d\0a\p2\p3\p4
  58.  
  59. \ *************************************************************************
  60.  
  61. \  The following equations handle lines that begin with an upper case or
  62. \  numbered outline point. Such lines are new paragraphs, so the preceding
  63. \  line must be tagged.
  64.  
  65. \n. *01=<EP>\0d\0a\p0\p1\p2*00
  66. \u. *01=<EP>\0d\0a\p0\p1\p2*00
  67. \0d\0a\n. =<EP>\0d\0a\p2\p3\p4
  68. \0d\0a\u. =<EP>\0d\0a\p2\p3\p4
  69.  
  70. \n) *01=<EP>\0d\0a\p0\p1\p2*00
  71. \u) *01=<EP>\0d\0a\p0\p1\p2*00
  72. \0d\0a\n) =<EP>\0d\0a\p2\p3\p4
  73. \0d\0a\u) =<EP>\0d\0a\p2\p3\p4
  74.  
  75. \  a run of cap characters followed by a colon is a new paragraph.
  76.  
  77. \u\^*(20)\x: *01=<EP>\0d\0a\p0\^1: *00
  78.  
  79. \ *************************************************************************
  80.  
  81. \  These equations tag an unresolved line followed by any printable character
  82. \  (except a lower case letter, which is handled separately above) with an end
  83. \  of paragraph. You can change the meaning of the equations removing the <EP>
  84. \  codes and replacing them with a word space. This would make all unresolved
  85. \  lines default to a continuation.
  86.  
  87. \v*01=<EP>\0d\0a\p0*00
  88. \u*01=<EP>\0d\0a\p0*00     \ *** CHANGE THESE TWO IF YOU ARE GETTING
  89. \n*01=<EP>\0d\0a\p0*00     \     TOO MANY MISMARKED PARAGRAPH ENDINGS ***
  90.  
  91. \ *************************************************************************
  92.  
  93. \  And finally, a CRLF by itself is always a paragraph end.
  94.  
  95. \0d\0a=<EP>\0d\0a*00
  96.  
  97.